<?php
$servername = "localhost";
$username = "root";
$password = "";

//Create Connection
$conn = new mysqli($servername, $username, $password);

//Check connection
if($conn->connect_error){
	die("Connection failed: " . $conn->connect_error);
}


//Create Database
$sql = "
CREATE DATABASE IF NOT EXISTS image_db;
USE image_db;

CREATE TABLE `images` (
  `id` int(10) AUTO_INCREMENT PRIMARY KEY,
  `image_name` VARCHAR(50) NOT NULL,
  `upload_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
";


if(!$conn->multi_query($sql)){
	
	echo "Error creating Database: ".$conn->error;
}


$conn->close();
?>